<d-form-control [suffixTemplate]="suffixTemplate">
  <input dTextInput name="inputPassword" [type]="showPassword ? 'text' : 'password'" />
</d-form-control>

<ng-template #suffixTemplate>
  <i [class]="showPassword ? 'icon icon-preview' : 'icon icon-preview-forbidden'" (click)="showPassword = !showPassword"></i>
</ng-template>
